<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>修改页面</title>
    <link rel="stylesheet" href="css/addgoods.css">

</head>
<body>
<div class="form-container">
    <h2>修改信息</h2>
    <form action="UpdateGoodsServlet" method="post">
        <input type="hidden" id="id" name="id" value="${g.id}" required>

        <div class="form-group">
            <label for="input_name" class="control-label">商品名称</label>
            <input type="text" class="form-control" id="input_name" name="name" required="required"
                   value="${g.name}">
        </div>

        <div class="form-group">
            <label for="input_price" class="control-label">商品价格</label>
            <input type="number" class="form-control" id="input_price" name="price" required="required"
                   value="${g.price}" min="0">
        </div>

        <div class="form-group">
            <label for="input_intro" class="control-label">商品介绍</label>
            <input class="form-control" id="input_intro" name="intro" rows="3"
                      value="${g.intro}">
        </div>

        <div class="form-group">
            <label for="input_stock" class="control-label">库存数量</label>
            <input type="number" class="form-control" id="input_stock" name="stock" required="required"
                   value="${g.stock}" min="0">
        </div>

        <div class="form-group">
            <label for="input_file" class="control-label">商品图片</label>
            <div class="file-input-wrapper">
                <div class="file-input-trigger">选择图片</div>
                <input type="file" name="cover" id="input_file" value="${g.cover}">
            </div>
            <span class="file-input-text">推荐尺寸：500*500</span>
        </div>
        <div class="form-group">
            <label for="select_topic" class="control-label">商品类别</label>
            <select class="form-control" id="select_topic" name="typeid" >
                <option value="1">手机</option>
                <option value="2">平板</option>
                <option value="3">电脑</option>
                <option value="4">汽车</option>
                <option value="5">家电</option>
            </select>
        </div>
        <div class="form-group">
            <button type="submit" class="submit-btn">提交修改</button>
        </div>
    </form>
</div>
</body>
</html>